package com.snopy.designPattern.observer;

import com.snopy.designPattern.observer.impl.EmailNotificationListener;
import com.snopy.designPattern.observer.impl.LogOpenListener;

/**
 * @author snopy
 * @version 1.0.0
 * @classname Demo
 * @description
 * @email 77912204@qq.com
 * @date 2022/03/16 16:31
 */
public class Demo {
    public static void main(String[] args) throws Exception {
        Editor editor = new Editor();
        editor.events.subscribe("open", new EmailNotificationListener("7791@gmail.com"));
        editor.events.subscribe("save",new LogOpenListener("E:/data.txt"));
        editor.openFile("E:/data.txt");
        editor.saveFile();
    }
}
